/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */

#ifndef RTI_SCHEDULER_H
#define RTI_SCHEDULER_H

#include "scheduler.h"
#include <stdint.h>
#include <pthread.h>
#include <map>
#include <utility>

namespace ns3 {

/**
 * \ingroup scheduler
 * \brief a std::map event scheduler which is hla compliant
 *
 * This class implements the an event scheduler using an std::map
 * data structure and extends it to make it hla compliant.
 */
class RtiScheduler : public Scheduler
{
public:
  static TypeId GetTypeId (void);

  RtiScheduler ();
  virtual ~RtiScheduler ();

  virtual void Insert (const Event &ev);
  virtual bool IsEmpty (void) const;
  virtual Event PeekNext (void) const;
  virtual Event RemoveNext (void);
  virtual void Remove (const Event &ev);
private:
  typedef std::map<Scheduler::EventKey, EventImpl*> EventMap;
  typedef std::map<Scheduler::EventKey, EventImpl*>::iterator EventMapI;
  typedef std::map<Scheduler::EventKey, EventImpl*>::const_iterator EventMapCI;


  EventMap m_list;
};

} // namespace ns3

#endif /* RTI_SCHEDULER_H */
